package com.whut.rssReader.activity;

import android.content.ContentResolver;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.LinearLayout;

public class MyDialog extends MyActivity implements OnClickListener{
	
	protected View pageView; 
	protected ContentResolver contentResolver;
	protected ViewGroup parentView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mydialog);
		parentView = (LinearLayout) findViewById(R.id.contentLayout);
		pageView = getPageView();
		contentResolver = getContentResolver();
		init();
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		// In order to not be too narrow, set the window size based on the screen resolution:
		final int screen_width = getResources().getDisplayMetrics().widthPixels;
		final int new_window_width = screen_width * 90 / 100;
		WindowManager.LayoutParams layout = getWindow().getAttributes();
		layout.width = Math.max(layout.width, new_window_width);
		getWindow().setAttributes(layout);
	}
	
	private void init() {
		parentView.addView(pageView, new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
	}

	public View getPageView(){
		return null;
	}

	@Override
	public void onClick(View v) {
		
	}

}
